The present invention relates to a method and apparatus for real time machine control, in particular, to the combination of state machine and task oriented paradigms.
Real-time and machine control software has typically been built using sequential tasks with assigned priorities. There are several problems with this approach. There are a number of physical components in an embedded system, which are all operating simultaneously. Having to control these several parallel activities using a sequential model makes the design and development of the control software very difficult. It is especially difficult when the control sequence must also account for unexpected events requiring alternative control flow, such as faults.
Also tasking has high overhead in terms of stack space per task. Task control block designs in operating systems restrict the total number of tasks in the system. This often forces the combination of separate pieces of functionality into one task, and compromises design freedom. This is particularly important in the context of object-oriented software, which encourages the decomposition of the system into a number of small interacting objects.
Also priority specifications are relative to each other. There is no direct relationship between the requirements of the application, and the scheduling priority that must be assigned to its task. Instead, the priority must be derived empirically by examining the behavior of the system as a whole. So applications programmers do not know how to assign priorities to their tasks and priority specifications are not reusable from one system to another.
The performance of tasking is often poor because of context-switching overhead. The timing behavior of priority-based scheduling is difficult to understand intuitively, because it depends on overall system characteristics. These two factors make it difficult to design embedded control software which will meet deadline requirements. This problem is typically addressed by extensive testing to reduce timing faults, though timing faults can still sometimes be observed in the final product. For want of a better approach, this is the way that embedded real-time software is built currently. It would be desirable, therefore, to be able to overcome at least some of the above difficulties in a control system.
In accordance with the present invention, the Machine Control Runtime (MCR)provides a breakthrough in this area, because it uses innovative concepts to simplify the development of machine control software. It does this by taking advantage of application characteristics. The bulk of the functionality in machine control applications consists of monitoring the state of devices, and sending control outputs to devices in timely fashion, with the output values being determined by a combination of the input values, and the current system state. Thus, machine control software primarily implements state machines for each system component. The timing requirements of machine control generally take the form of response time requirements i.e. maximum time that may elapse before an output must be produced in response to an input.
It is the object of the present invention, therefore, to provide state functionality by using special constructs for state machine programming, integrating this event-driven paradigm with the conventional tasking paradigm, and to provide scheduling based on response time specification. Some of the other innovative features of the Machine Control Runtime include object-oriented abstractions of inputs and outputs, reference clocks to enable more flexible expression of timing requirements, and a less error-prone application interface for disabling interrupts.
Other advantages of the present invention will become apparent as the following description proceeds, and the features characterizing the invention will be pointed out with particularity in the claims annexed to and forming a part of this specification.
A typical prior art control, assigned to the assignee of the present invention, is disclosed in U.S. Pat. No. 4,800,521 showing tasks residing in multiple processors. Each of the tasks comprises a block of instructions and is operated on in one of the processors. A plurality of tasks are operated on concurrently by providing start instructions in sequence to consecutive tasks.
A method of use of real time machine control software integrating both event based mode and task based components. In particular, a collection of constructs have been created that allow machine control applications to be expressed in event based terms and the event based constructs seamlessly integrated with task based constructs. The method includes the use of response time specifications, in particular in conjunction with ReactiveTask and Task constructs. The method also includes the use of Register, ReferenceClock, and SchedulerLock constructs.